<?php
	/**
	 * @package AmpleHarvest
	 */
	namespace ampleharvest\code\usermanager\tables;
	
	use\ampleharvest\permissions;
	use\ampleharvest\code;

	require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config/cConfig.php';
	require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config/cPermissions.php';
	require_once 'cTABLE_Applications.php';

	$config = new \ampleharvest\code\cConfig();
	require_once $config->C_STR_USER_MANAGER_PATH . "/Classes/cTABLE_Actions.php";
	/**
	 * @brief Adds new actions to the Actions Table in the User Manager database
	 *
	 * - Revision History
	 *  - 0.1
	 * 	 - <b>Date</b>: 24 MAR 2011
	 * 	 - <b>Author</b>: Randy Blancett
	 * 	  - Initial Version
	 *
	 * @author Randy Blancett
	 * @version 0.1
	 * @ingroup code classes table  user_manager
	 */
	class cTABLE_Actions extends \cTABLE_Actions
	{
		/**
		 * Inserts default information into the table this adds required information 
		 * that is needed for AmpleHarvest to function.
		 */
		public function insert_DefaultData()
		{
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_COMMENTING_ALL_CRUD);
			$this->set_Name("Commenting CRUD");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows users to create, read, update, and delete comments.");
			
			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_SAVED_QUERY_ADD);
			$this->set_Name("Add Saved Queries");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows users to save queries to a list for later use.");

			$this->save_Data2DB();

			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_SAVED_QUERY_VIEW);
			$this->set_Name("View Saved Queries");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows users to view queries that have been saved.");

			$this->save_Data2DB();

			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_SAVED_QUERY_DELETE);
			$this->set_Name("Delete Saved Queries");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows users to delete queries that have been saved.");

			$this->save_Data2DB();

			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_SAVED_QUERY_EDIT);
			$this->set_Name("Edit Saved Queries");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows users to edit queries that have been saved.");

			$this->save_Data2DB();
			
			//Harvest Request
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_DEACTIVATE);
			$this->set_Name("Deactivate Harvest Request");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allows Users to deactivate a harvest Request.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_ALL_STAGE1);
			$this->set_Name("Edit All Harvest Request (Stage 1)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit any Harvest Request that is in the first stage of Processing.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_ALL_STAGE2);
			$this->set_Name("Edit All Harvest Request (Stage 2)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit any Harvest Request that is in the second stage of Processing.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_DISCUSSIONS);
			$this->set_Name("Edit Harvest Request Discussions");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit a Harvest Request Discussion.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_OWN_STAGE1);
			$this->set_Name("Edit Own Harvest Request (Stage 1)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit their Harvest Request that are in the first stage of Processing.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_OWN_STAGE2);
			$this->set_Name("Edit Own Harvest Request (Stage 2)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit their Harvest Request that are in the second stage of Processing.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_EDIT_STATUS);
			$this->set_Name("Edit Harvest Request Status");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Edit the status of a Harvest Request.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_REQUEST_DEACTIVATE_ALL);
			$this->set_Name("Request Harvest Request Deactivation (All)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to request the deactivation of any Harvest Request.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_REQUEST_DEACTIVATE_OWN);
			$this->set_Name("Request Harvest Request Deactivation (Own)");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to request the deactivation of their Harvest Request.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_SUBMIT);
			$this->set_Name("Submit Harvest Request");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to Submit a Harvest Request.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_VIEW_ALL);
			$this->set_Name("View All Harvest Request");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to view all Harvest Requests.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_HR_VIEW_DISCUSSIONS);
			$this->set_Name("View Harvest Request Discussions");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow users to view discussions about Harvest Requests.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_STATISTICS_VIEW);
			$this->set_Name("View AmpleHarvest Statistics");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to view AmpleHarvest Statistics.");

			$this->save_Data2DB();
			
			//Data Permisions
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_DATA_ADD);
			$this->set_Name("Add AmpleHarvest Data");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users add data to the AmpleHarvest Data Table.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_DATA_DELETE);
			$this->set_Name("Delete AmpleHarvest Data");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users delete data from the AmpleHarvest Data Table.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_ADMIN_VIEW);
			$this->set_Name("View AmpleHarvest Admin");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to view pages associated with administrative functions for AmpleHarvest.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_ADMIN_VIEW_STATUS);
			$this->set_Name("View AmpleHarvest Status");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to view the over all status of AmpleHarvest components.");

			$this->save_Data2DB();
			
			//Group Permissions
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_GROUP_APPROVE);
			$this->set_Name("Approve Group Request");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to approve requests for Ampleharvest groups.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_GROUP_EDIT);
			$this->set_Name("Edit Groups");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to edit any user group in AmpleHarvest.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_GROUP_VIEW_INFO);
			$this->set_Name("View Group Information");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to view any user group in AmpleHarvest.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_GROUP_REQUEST);
			$this->set_Name("Request Group");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users to request a group be created.");

			$this->save_Data2DB();
			
			$this->set_ID(permissions\cPermissions::C_STR_PERMISION_GROUP_VIEW_PENDING);
			$this->set_Name("View Pending Group Requests");
			$this->set_Application(cTABLE_Applications::C_STR_APPLICATION_AMPLE_HARVEST);
			$this->set_Comment("Allow Users view pending group requests.");

			$this->save_Data2DB();
			
			return true;
		}
	}
?>
